With the development of network technology, people often uploads a file to a network location, that is, the file is stored in a network hard disk of a storage server, i.e. IP (Internet Protocol) hard disk, which saves a storage space of a local client and avoids the loss of file. Here, the storage server includes at least one IP hard disk, one of which corresponds to multiple keys; one stripe corresponds to multiple keys, and one stripe may correspond to one or more IP hard disks; one key only stores one file, and one file can be stored in multiple keys.
At present, when a file is stored, the metadata of the file needs to be stored. As such, when there is a data access requirement, the storage server obtains the file according to the metadata. Here, the metadata may include: sub-metadata corresponding to file information such as a file name, an identifier of a domain in which a key is located, an offset of data stored in the key in the file, a length of data stored in the key and the like, and sub-metadata corresponding to stripe information such as a stripe identifier and the number of a key in the stripe. The sub-metadata corresponding to the file information is constant, and the sub-metadata corresponding to the stripe information may change. For example, after the storage server deletes files, strips corresponding to the deleted files may be recycled. However, the recycled strips may additionally correspond to files that are not deleted. In this case, other stripes will be assigned to these files that are not deleted, resulting in the change of the sub-metadata corresponding to the stripe information.
After the metadata is lost, even if the data of the file is read, it is not possible to distinguish which file the read data belongs to, thereby causing the loss of the file.
In order to avoid the loss of the file, the file is usually stored by the following method for backing up metadata.
When a file is stored, the metadata of the file is stored in a metadata database, and then the metadata of the file is stored in a backup metadata database. When the metadata in the metadata database is lost, the lost metadata in the metadata database is recovered by the metadata in the backup metadata database, avoiding the loss of the file. In this way, although the security of the metadata is enhanced and the recovery of the metadata in the metadata database can be ensured, additional storage space is needed to store the metadata in the backup metadata database.
It can be seen from the above that in order to avoid the loss of file and ensure that the lost metadata can be recovered, additional storage space is required, which reduces the effective utilization of the storage space.